home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / Tools & Goodies / IntlTest / Sources / Content.h < prev    next >
Encoding:
Text File  |  1996-09-12  |  4.5 KB  |  140 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Content.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Written by:            Mary Boetcher
  7. //
  8. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef CONTENT_H
  13. #define CONTENT_H
  14.  
  15. #ifndef DEFINES_K
  16. #include "Defines.k"
  17. #endif
  18.  
  19. // ----- Framework Includes -----
  20.  
  21. #ifndef FWCONTNT_H
  22. #include "FWContnt.h"
  23. #endif
  24.  
  25. //========================================================================================
  26. //    Forward Declarations
  27. //========================================================================================
  28.  
  29. class CIntlTestPart;
  30. class FW_CEditView;
  31.  
  32. //========================================================================================
  33. //    class CIntlTestContent
  34. //========================================================================================
  35.  
  36. class CIntlTestContent : public FW_CContent
  37. {
  38.   public:
  39.     FW_DECLARE_AUTO(CIntlTestContent)
  40.     
  41.     CIntlTestContent(Environment* ev, CIntlTestPart* part);
  42.     virtual ~CIntlTestContent();
  43.  
  44.   public:
  45.     virtual void        ExternalizeKind(Environment* ev,
  46.                                      ODStorageUnit* storageUnit,
  47.                                       FW_CKind* kind,
  48.                                      FW_StorageKinds storageKind,
  49.                                      FW_CPromise* promise,
  50.                                      FW_CCloneInfo* cloneInfo);
  51.     virtual FW_Boolean    InternalizeKind(Environment* ev,
  52.                                      ODStorageUnit* storageUnit, 
  53.                                       FW_CKind* kind,
  54.                                      FW_StorageKinds storageKind,
  55.                                      FW_CCloneInfo* cloneInfo);
  56.  
  57. //----------------------------------------------------------------------------------------
  58. //    New Stuff
  59. //
  60.   public:
  61.     void        ExternalizePartKind(Environment* ev, ODStorageUnit* destinationSU, ODType partKind);
  62.     FW_Boolean    InternalizePartKind(Environment* ev, ODStorageUnit* sourceSU, ODType partKind);
  63.  
  64.     const FW_CString&    GetTextData(ODID whichView);
  65.     void                SetTextData(Environment* ev, const FW_CString& newText, ODID whichView);
  66.  
  67. //----------------------------------------------------------------------------------------
  68. //    Data Members
  69. //
  70.   protected:
  71.     FW_CString255        fEnglishText;
  72.     FW_CString            fJapaneseText;
  73.  
  74.     CIntlTestPart*        fIntlTestPart;
  75. };
  76.  
  77. //========================================================================================
  78. //    class CIntlTestSelectedContent
  79. //========================================================================================
  80.  
  81. class CIntlTestSelectedContent : public FW_CContent
  82. {
  83.   public:
  84.     FW_DECLARE_AUTO(CIntlTestSelectedContent)
  85.     
  86.     CIntlTestSelectedContent(Environment* ev, CIntlTestPart* part);
  87.     virtual ~CIntlTestSelectedContent();
  88.  
  89.   public:
  90.     virtual void        ExternalizeKind(Environment* ev,
  91.                                      ODStorageUnit* storageUnit,
  92.                                       FW_CKind* kind,
  93.                                      FW_StorageKinds storageKind,
  94.                                      FW_CPromise* promise,
  95.                                      FW_CCloneInfo* cloneInfo);
  96.     virtual FW_Boolean    InternalizeKind(Environment* ev,
  97.                                      ODStorageUnit* storageUnit, 
  98.                                       FW_CKind* kind,
  99.                                      FW_StorageKinds storageKind,
  100.                                      FW_CCloneInfo* cloneInfo);
  101.  
  102. //----------------------------------------------------------------------------------------
  103. //    New Stuff
  104. //
  105.     FW_CString GetInternalizedText();
  106.     void GetSelectedText(Environment* ev, FW_CString& text);
  107.     void SetSelectedText(Environment* ev, const FW_CString& newText);
  108.     void ClearSelectedText(Environment* ev);
  109.     void SetSelectionRange(Environment* ev, short startOffset, short endOffset);
  110.     void SetEditView(FW_CEditView* editView);
  111.  
  112. //----------------------------------------------------------------------------------------
  113. //    Data Members
  114. //
  115.   protected:
  116.     CIntlTestPart*        fIntlTestPart;
  117.     FW_CEditView*        fEditView;            // selected edit view
  118.     FW_CString            fInternalizedText;    // holds text that was just internalized
  119. };
  120.  
  121. //----------------------------------------------------------------------------------------
  122. inline FW_CString CIntlTestSelectedContent::GetInternalizedText()
  123. {
  124.     return fInternalizedText;
  125. }
  126.  
  127. //----------------------------------------------------------------------------------------
  128. inline void CIntlTestSelectedContent::SetEditView(FW_CEditView* editView)
  129. {
  130.     fEditView = editView;
  131. }
  132.  
  133. //========================================================================================
  134. // Prototypes
  135. //========================================================================================
  136. FW_Boolean InternalizeIntlText(Environment* ev, ODStorageUnit* storageUnit, FW_CString& textData);
  137. FW_Boolean InternalizeText(Environment* ev, ODStorageUnit* storageUnit, FW_CString& textData);
  138.  
  139.  
  140. #endif